<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{ config('app.name', 'Laravel') }}</title>

    <link href="{{ asset('style/index_style.css') }}" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="{{ asset('js/jquery-1.11.1.min.js') }}"></script>
    <script type="text/javascript" src="{{ asset('js/jquery.SuperSlide.2.1.1.js') }}"></script>
    <script type="text/javascript" src="{{ asset('js/jquery.lazyload.js') }}"></script>

</head>
<body>

<div id="m_head">
    <div class="m_head">
        <div class="nav_logo"><a href="" class="logo"></a></div>
        <div class="head_nav m-l-10">
            <li><a href="">首页</a></li>
            <li><a href="">分类</a>
                <ul class="list_link">
                    <li>背景元素
                        <div class="hello_link"></div>
                    </li>
                    <li>透明字体</li>
                    <li>透明图标</li>
                </ul>
            </li>
            <li><a href="">办公创意</a></li>
            <li><a href="">视听库</a></li>
            <li><a href="">VIP特权</a></li>
        </div>
        <div class="login" id="login">
            @auth
                <a href="{{ route('logout') }}" class="reg_btn"  onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();" id="sub_reg">{{ __('Logout') }}</a>
                <a href="javascript:void(0)" class="login_btn" id="sub_login">{{ Auth::user()->name }}</a>
                <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                    @csrf
                </form>
            @else
                <a href="javascript:void(0)" class="reg_btn" id="sub_reg">注册</a>
                <a href="javascript:void(0)" class="login_btn" id="sub_login">登录</a>
            @endauth
        </div>
    </div>
</div>


<div class="focusBox" style="margin:0 auto">
    <ul class="pic">
        <li><a href="http://www.sucaiyi.com" target="_blank"><img src="images/111.jpg"/></a></li>
        <li><a href="http://www.sucaiyi.com" target="_blank"><img src="images/111.jpg"/></a></li>
        <li><a href="http://www.sucaiyi.com" target="_blank"><img src="images/111.jpg"/></a></li>
        <li><a href="http://www.sucaiyi.com" target="_blank"><img src="images/111.jpg"/></a></li>
        <li><a href="http://www.sucaiyi.com" target="_blank"><img src="images/111.jpg"/></a></li>
    </ul>
    <a class="prev" href="javascript:void(0)"></a>
    <a class="next" href="javascript:void(0)"></a>
    <ul class="hd">
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</div>




@yield('content')

@yield('script')

<div id="footer">

    <div class="footer">
        <div class="foot_link clearfix">
            <li><a href="">关于我们</a></li>
            <li><a href="">用户协议</a></li>
            <li><a href="">帮助中心</a></li>
            <li><a href="">联系我们</a></li>
            <li></li>
            <div class="media_icon">
                <a href="javascript:void(0)" class="weixin"></a>
                <a href="javascript:void(0)" class="weibo"></a>

            </div>
        </div>
        <div class="web_link">
            <span class="fl">友情链接：</span>
            <li>素材易</li>
            <li>素材易</li>
            <li>素材易</li>
            <li>素材易</li>
            <li>素材易</li>


        </div>

        <div class="copy-l fl"><p><a target="_blank" href="http://www.miitbeian.gov.cn" class="gov">川ICP备8888888号</a><a
                        target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=31011502006998"
                        style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img
                            src="images/wa.png"><span style="height:20px;line-height:20px;margin-left:5px; color:#939393;">川公网安备 8888888号</span></a>
            </p>
            <p><span class="info">© Copyright 2016-2017 XXX科技有限公司 版权所有 sucaiyi.com</span></p></div>
    </div>
</div>


<!--登录层-->
<div id="fade-bg" class="popup popup_r"></div>
<div id="hide-center" class="popup popup_r">
    <!--三方登录-->
    <div class="CL_dia_log popup" style="display: none">
        <div class="title SNS_login">登录素材易</div>
        <div class="login-close"><span onclick="Cl_close()">×</span></div>
        <div class="login-box">
            <div class="bt-l"><a href="javascript:void(0)">
                    <div class="qq"></div>
                    <p>QQ登录</p></a></div>
            <div class="bt-r"><a href="javascript:void(0)">
                    <div class="wx"></div>
                    <p>微信登录</p></a></div>
        </div>
        <div class="login-change">
            <div class="sms-login"><a href="javascript:void(0)" class="c-2" onclick="CLLogin.CLogin()">短信登录</a></div>
            <div class="reg-btn c-2">没有注册？<a href="javascript:void(0)" class="c-1"
                                             onclick="CLLogin.CreGister()">立即注册</a></div>
        </div>
    </div>

    <!--账号登录-->
    <div class="CL_dia_log smsLogin" style="display: none">
        <div class="title C_Login">账号登录</div>
        <div class="login-close"><span onclick="Cl_close()">×</span></div>
        <div class="input_box">
            <div class="user_input">
                <input type="text" class="login_index input-length-m" id="login_phone" placeholder="email" onfocus="this.placeholder=''"
                       onblur="this.placeholder='email'"><p align="center" class="error_phone error"></p> </div>
            <div class="user_input">
                <input type="text" class="login_index input-length-s" id="login_code"  placeholder='密码' onfocus="this.placeholder=''"
                       onblur="this.placeholder='密码'"><a href="javascripg:void(0)" type="submit" class="send-button" >发送验证码</a>
                <p align="center" class="error_code error"></p>
            </div>

            <div class="sub-login">
                <input type="button" class="index_btn colours" id="login_sub" value="立即登录">
            </div>
        </div>
        <div class="login-change">
            <div class="sms-login"><a href="javascript:void(0)" class="c-2" onclick="CLLogin.SNSLogin()">社交账号登录</a>
            </div>
            <div class="reg-btn c-2">没有注册？<a href="javascript:void(0)" class="c-1"
                                             onclick="CLLogin.CreGister()">立即注册</a></div>
        </div>

    </div>



    <!--账号注册-->
    <div class="CL_dia_log popup_r" style="display: none">
        <div class="title CL_register">账号注册</div>
        <div class="login-close"><span onclick="Cl_close()">×</span></div>
        <div class="login-box">
            <div class="bt-l"><a href="javascript:void(0)">
                    <div class="qq"></div>
                    <p>QQ注册</p></a></div>
            <div class="bt-r"><a href="javascript:void(0)">
                    <div class="wx"></div>
                    <p>微信注册</p></a></div>
        </div>
        <div class="login-change"><p class="c-2">点击注册代表你同意注册声明、版权声明</p>
            <p class="c-2">已有账号？<a href="javascript:void(0)" class="c-1" onclick="CLLogin.SNSLogin()">立即登录</a></p></div>
    </div>
</div>


<!--轮播控制-->
<script type="text/javascript">
    /*鼠标移过，左右按钮显示*/
    jQuery(".focusBox").hover(function () {
        jQuery(this).find(".prev,.next").stop(true, true).fadeTo("show", 0.2)
    }, function () {
        jQuery(this).find(".prev,.next").fadeOut()
    });
    /*图片切换*/
    jQuery(".focusBox").slide({mainCell: ".pic", effect: "fold", autoPlay: true, delayTime: 600, trigger: "click"});
</script>


<script>

    /*弹出登录层*/
    $('#login #sub_login').click(function () {
        $('.popup').show();
        return false
    });
    $('#login #sub_reg').click(function () {
        $('.popup_r').show();
        return false
    });

    function Cl_close() {/*关闭登录弹出层*/
        $('.popup').hide() && $('.popup_r').hide() && $('.smsLogin').hide();
    };
    var CLLogin = {
        SNSLogin: function () {/*切换社交登录*/
            $('.CL_dia_log').hide();
            $('.CL_dia_log .SNS_login').parent().show();
        },
        CLogin: function () {/*切换到登录*/
            $('.CL_dia_log').hide();
            $('.CL_dia_log .C_Login').parent().show();
        },
        CreGister: function () {/*切换到注册*/
            $('.CL_dia_log').hide();
            $('.CL_dia_log .CL_register').parent().show();
        }
    };
    //手机焦点
    $("#login_phone").blur(function () {
        var str = $(this).val();
        if (str.length < 1 && str) {
            $(".error_phone").html("请输入正确的手机号！");
            $(this).addClass("error-border");
        } else {
            $(".error_phone").html("");
            $(this).removeClass("error-border");
        }
    });
    //验证码焦点
    $("#login_code").blur(function () {
        var str = $(this).val();
        if (str.length <0) {
            $(".error_code").html("验证码不可为空！");
            $(this).addClass("error-border");
        } else {
            $(".error_code").html("");
            $(this).removeClass("error-border");
        }
    });
    //  手机登录注册验证
    $('#login_sub').click(function () {
        var phone = $("#login_phone").val();
        var code = $("#login_code").val();
        if(phone == "") {
            $('.error_phone').html("请填写手机号码");
            $("#login_phone").addClass("error-border");
            return false
        }
        if(code == "") {
            $('.error_code').html("请获取验证码");
            $("#login_code").addClass("error-border");
            return false
        }

        $.ajax({
            headers: {
                "Accept": "application/json; charset=utf-8",
                "X-CSRF-TOKEN" : $('meta[name="csrf-token"]').attr('content')
            },
            url: "{{ route('login') }}",
            method: 'POST',
            data: {
                'email':phone,
                'password':code
            },
            success:function (data) {
                if ( data.status === 0 ){
                    window.location.reload()
                } else {
                    $('.error_code').html(data.errMsg);
                    $("#login_code").addClass("error-border");
                }
            }
        });
    });
    // 图片懒加载
    $(function () {
        $("img.lazy").lazyload({
            placeholder: "../images/grey.gif", //用图片提前占位
            skip_invisible: false,
            effect: "fadeIn", // 载入使用何种效果
        })
    });
</script>


</body>
</html>